@extends('layouts.back_stage')
@section('content')
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.select.js"></script>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.page.js?v=1.0.4"></script>
    <style>
        .form_ul{width:100%;height:30px;margin-bottom:20px;}
        .form_li{width:210px;line-height:30px;margin-right:10px;float:left;font-size:14px;}
        .form_inp{width:130px;height:30px;line-height:30px;font-size:14px;float:right;outline:none;border:1px solid #cfdada;background:#fff;border-radius:2px;padding:6px 12px;color:#555;box-shadow: none;}
        .sel_inp{width:130px;height:30px;line-height:30px;font-size:14px;float:right;outline:none;border:1px solid #cfdada;background:#fff;border-radius:2px;padding:4px 8px;color:#555;box-shadow: none;}
        .fabric_div1{width:100%;}
        .tab1{border-collapse:collapse;width:100%;font-size:14px;color:#383838;background:#fff;margin-bottom:10px;}
        table td{text-align:center;height:35px;}
        table,th,td{border:1px solid #ccc;}
        .oneTb{width:100%;overflow-x:scroll;overflow-y:hidden;}
        ::-webkit-scrollbar{width:5px;height:5px;}
        .tab1 .form_inp,.tab1 .sel_inp{width:100%;height:100%;outline:none;background:#fff;border:none;padding:0;cursor:pointer;text-align:center;}
        /*遮罩层*/
        .mask{position:fixed;top:0;right:0;left:0;bottom:0;z-index:10000;background:#000;opacity:0.8;filter:alpha(opacity=80);-moz-user-select: none; -webkit-user-select: none;}
        /*弹框1*/
        .info_box{position:absolute;top:25%;left:30%;width:800px;height:auto;overflow:hidden;background:#fff;z-index:99999;padding:15px;display:none;}
        .chaL{position:absolute;top:-3px;right:0;color:red;font-size:20px;cursor:pointer;}
        .gong{width:100%;}
        .gong tbody tr:hover{background:#27c24c;cursor:pointer;color:#fff;}
        .shuoM{appearance:none;-moz-appearance:none;-webkit-appearance:none;text-indent:10px;}
        .tab1 .shuoM,.tab1 .guiGe,.tab1 .xiaoL,.tab1 .danW{background:#F5F5F5;cursor:default;}
        .save_add{margin-top:30px;margin-left:50%;}
        /*弹框2*/
        .boxJxd{position:fixed;top:20%;left:20%;width:1000px;height:auto;overflow:hidden;background:#fff;z-index:99999;padding:15px;display:none;}
        .yinClose{position:absolute;top:-3px;right:0;color:red;font-size:20px;cursor:pointer;}
        .seek_p{width:100%;margin:0 auto;padding-top:10px;}
        .seek_lab{width:185px;line-height:30px;margin-right:10px;}
        .seek_sel{width:130px;height: 30px;line-height:30px;float:right;outline:none;font-size: 13px;padding:5px 10px;font-weight: normal;border-radius: 2px;color: #555;background:#fff;background-image: none;border: 1px solid #cfdadd;box-shadow: none;}
        .bt_del{text-align: center;display:inline-block;}
        .fabric-choose{width:100%;line-height:30px;height:30px;margin:20px auto;}
        .fabric_div2{width:100%;}
        .fabric_div3{width:100%;margin-top:30px;}
        .tab2,.tab3{border-collapse:collapse;width:100%;font-size:14px;color:#383838;background:#fff;margin-bottom:10px;}
        .twoTb{width:100%;}
        .threeTb{width:100%;overflow-y:hidden;}
        .two_tr{cursor:pointer;}
        .two_tr.in{background:#27c24c;color:#fff;}
        .colr{color:red;}
    </style>
    <script>
        //供应商
        var suppliers = [
            <?php $j = count($suppliers_arr);$i = 0; ?>
                    @foreach ($suppliers_arr as $k=>$v )'{{$v["name"]}}'<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
    </script>
    <div class="container">
        <div class="row">
            <div style="margin:30px;"><h3 >添加采购通知单<span style="color:red;font-size:14px;">(先引单再添加)</span></h3></div>
            <div style="width:95%;margin-left:40px;">
                <div class="form-group">
                    <h3 style="float:left;margin-right:20px;">基本信息</h3>
                    <a class="btn btn-primary yinDan" href="javascript:;" abc="{{$notice_infos->plan_id}}">引单</a>
                </div>
                <div class="form-group">
                    <ul class="form_ul">
                        <li class="form_li" style="width:300px;">供应商：<input id="colorInput0" class="form_inp supplier_name" value="{{$notice_infos->suppliers_name}}" type="text" autocomplete="off" autocorrect="off" placeholder="供应商" style="width:220px;"  /></li>
                        <li class="form_li">销售季节：
                            <select class="sel_inp quarter">
                                <option value="">请选择</option>
                                @if(count($season))
                                    @foreach($season as $k => $v)
                                        <option value="{{$v}}" @if(isset($notice_infos->sale_quarter) && $notice_infos->sale_quarter==$v) selected @endif>{{$v}}</option>
                                    @endforeach
                                @endif
                            </select>
                        </li>
                        <li class="form_li">收货仓库：
                            <select class="sel_inp warehouse">
                                @if(!empty($notice_infos->warehouse))
                                <option value="{{$notice_infos->warehouse}}">{{$notice_infos->warehouse}}</option>
                                @endif
                                <option value="">请选择</option>
                                <option value="公司面料仓库">公司面料仓库</option>
                                <option value="公司辅料仓库">公司辅料仓库</option>
                            </select>
                        </li>
                    </ul>
                    <ul class="form_ul">
                        <li class="form_li" style="width:380px;">开户行：<input style="width:300px;" class="form_inp redl" value="{{$notice_infos->bank_account}}" type="text"  /></li>
                        <li class="form_li" style="width:545px;">服务款号：<input style="width:465px;" class="form_inp ser_gir" value="{{$notice_infos->server_girards}}" type="text" autocomplete="off" autocorrect="off" placeholder="服务款号"  /></li>
                    </ul>
                    <ul class="form_ul">
                        <li class="form_li" style="width:935px;">备注：<input style="width:855px;"class="form_inp remark" value="{{$notice_infos->remark}}" type="text" autocomplete="off" autocorrect="off" placeholder="备注"  /></li>
                    </ul>
                    <ul class="form_ul">
                        <li class="form_li" style="width: 235px;">采购计划单号：<input disabled class="form_inp plan_num" value="{{$notice_infos->plan_num}}" type="text"  /></li>
                        <li class="form_li" style="width: 235px;">采购通知单号：<input style="padding:6px 10px;" disabled class="form_inp notice_num" value="{{$notice_infos->notice_num}}" type="text"  /></li>
                    </ul>
                </div>
                <div class="form-group">
                    <a class="btn btn-primary addIns" href="javascript:;">添加</a>
                </div>
                <div class="form-group oneTb">
                    <div class="fabric_div1">
                        <table class="tab1">
                            <thead>
                            <tr>
                                <td style="min-width:70px;">类型</td>
                                <td>厂家货号</td>
                                <td style="min-width:80px;">面辅料颜色</td>
                                <td style="min-width:80px;background:#f5f5f5;">颜色说明</td>
                                <td style="background:#f5f5f5;">小类</td>
                                <td style="background:#f5f5f5;">面辅料规格</td>
                                <td>单价</td>
                                <td>数量</td>
                                <td>金额</td>
                                <td style="background:#f5f5f5;">单位</td>
                                <td style="width:45px;">操作</td>
                            </tr>
                            </thead>
                            <tbody>
                            @if(count($fabric_infos))
                                @foreach($fabric_infos as $k => $v)
                                    @if($v['design_details_id']>0)
                                    <tr class="tr{{$v['design_details_id']}}" ids="{{$v['design_details_id']}}">
                                    @else
                                    <tr class="newInfos" ids="0">
                                    @endif
                                        <td>
                                            <select class="sel_inp types">
                                                @if(isset($v['type']) && $v['type']=='面')
                                                    <option value="main">面</option>
                                                    <option value="other">辅</option>
                                                @elseif(isset($v['type']) && $v['type']=='辅')
                                                    <option value="other">辅</option>
                                                    <option value="main">面</option>
                                                @else
                                                    <option value="">请选择</option>
                                                    <option value="main">面</option>
                                                    <option value="other">辅</option>
                                                @endif
                                            </select>
                                        </td>
                                        <td><input class="form_inp fabric_num rek{{$v['index']}}" type="text" abc="{{$v['cloth_id']}}" value="{{$v['fabric_num']}}"></td>
                                        <td>
                                            <select class="sel_inp colB">
                                                <option value="">请选择</option>
                                                @foreach($v['color_arr'] as $kk => $vv)
                                                <option value="{{$vv['id']}}" @if($v['color']==$vv['color_name']) selected @endif >{{$vv['color_name']}}</option>
                                                @endforeach
                                                </select>
                                            </td>
                                        <td>
                                            <select disabled class="sel_inp shuoM">
                                                <option value=""></option>
                                                @foreach($v['color_remark_arr'] as $kk )
                                                <option value="{{$kk}}" @if($kk==$v['color_remark']) selected @endif>{{$kk}}</option>
                                                @endforeach
                                            </select>
                                        </td>
                                        <td><input disabled class="form_inp xiaoL" type="text" value="{{$v['fabric_name']}}"></td>
                                        <td><input disabled class="form_inp guiGe" type="text" value="{{$v['specification']}}"></td>
                                        <td><input class="form_inp feis danJ" type="text" value="{{$v['cost']}}"></td>
                                        <td><input class="form_inp liang shuL" type="text" value="{{$v['purchase_need']}}"></td>
                                        <td><input disabled class="form_inp jinE" type="text" value="{{$v['cost']*$v['purchase_need']}}"></td>
                                        <td><input disabled class="form_inp feis danW" type="text" value="{{$v['unit']}}"></td>
                                        <td><a href="javascript:;" class="delOpe" @if(isset($v['id'])) abc="{{$v['id']}}" @else @endif>删除</a></td>
                                    </tr>
                                @endforeach
                            @endif
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="form-group"><button type='button' class='save_add btn btn-success' abc="{{$notice_infos->id}}">保存</button></div>
            </div>
        </div>
    </div>
    {{--弹框1--}}
    <div class="info_box">
        <h3 style="text-align:center;position:relative;margin-bottom:20px;"><span class="infoAdd"></span><i class="fa fa-close chaL"></i></h3>
        <div class="form-group">
            <ul class="form_ul">
                <li class="form_li" style="width:auto;">关键词：<input class="form_inp keywos" type="text" autocomplete="off" autocorrect="off" placeholder="请输入关键词" /></li>
                <button type='button' class='btn btn-info souGo'>搜索</button>
            </ul>
        </div>
        <div class="form-group">
            <table class="gong">
                <thead><tr><td style="width:350px;">供应商</td><td>供应商货号</td></tr></thead>
                <tbody></tbody>
            </table>
        </div>
        <div class="form-group">
            <div class="page1" style="width:430px;float:right;"></div>
        </div>
    </div>
    {{--弹框2--}}
    <div class="boxJxd">
        <h3 style="text-align:center;position:relative;margin-bottom:20px;"><span class="infoAdd"></span><i class="fa fa-close yinClose"></i></h3>
        <div class="container">
            {{--采购计划单--}}
            <div><h3>采购计划单选择</h3></div>
            <div class="form-group">
                <form>
                    <p class="seek_p">
                        <label class="seek_lab" style="width:205px;">销售季节：
                            <select class="seek_sel sale_quarter" name="sale_quarter">
                                <option value="">请选择</option>
                                @if(count($season))
                                    @foreach($season as $k => $v)
                                        <option value="{{$v}}" @if(isset($plan_info->sale_quarter) && $plan_info->sale_quarter==$v) selected @endif>{{$v}}</option>
                                    @endforeach
                                @endif
                            </select>
                        </label>
                        <label class="seek_lab" style="width:185px;">供应商：
                            <select class="seek_sel supplier_id">
                                <option value="">请选择</option>
                                @foreach($plan_suppliers as $k => $v)
                                    <option value="{{$v->supplier_id}}">{{$v->name}}</option>
                                @endforeach
                            </select>
                        </label>
                        <label class="seek_lab">款号：<input class="seek_sel girard" type="text" autocomplete="off" autocorrect="off" placeholder="款号" name="girard" value="" /></label>
                        <button type="button" class="btn bt_del btn-info" onclick="grabble()">搜索</button>
                        <a class="btn bt_del btn-info" href="javascript:;" onclick="emptyFabric()">清空</a>
                    </p>
                </form>
            </div>
            <div class="fabric-choose">
                <span>共<span class="mate_count2">0</span>条信息</span>
                <a class="btn btn-info bt_a sureB" href="javascript:;" abc="{{$notice_infos->id}}" def="">确定</a>
            </div>
            <div class="form-group twoTb">
                <div class="fabric_div2">

                </div>
            </div>
            <span class="page2" style="float:right;"></span>
            <div style="width:100%;border-top:1px solid #ccc;float:right;height:1px;margin-top:15px;"></div>
            <div class="form-group threeTb">
                <div class="fabric_div3">

                </div>
            </div>
        </div>
    </div>
    <div class="mask" style="display:none;"></div>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/noticeUp.js?v=1.0.9"></script>
@endsection